import axios from 'axios'
import {useLoginStore} from "../store/useLoginStore"

axios.defaults.baseURL="http://localhost:8080"
axios.defaults.timeout=10000
axios.interceptors.request.use(config=>{
    let loginUser = useLoginStore();
    let userVo = loginUser.loginUser;
    if(userVo){
        config.headers.token=userVo.tokenVo.token;
    }

    return config;
})

export default axios